define([],function(){
	var tpl = {};

	tpl.nodes = function(){
		return nodes();
	}
	tpl.tasks = function(){
		return tasks();
	}
	tpl.dates = function(){
		return dates();
	}
	tpl.editDateWrap = function(){
		return editDateWrap();
	}
	tpl.editDate = function(){
		return editDate();
	}
	tpl.editWrap = function(){
		return editWrap();
	}
	tpl.questWrap = function(){
		return questWrap();
	}
	tpl.baseInfo = function(){
		return baseInfo();
	}

	var nodes = function(){
		return 	'<script id="tpl_user_nodes" type="text/html">'+
				'	<div class="user-cp clearfix">'+
				'		{{each list as value i}}'+
				'		<div class="item" index="{{value.index}}" data-isClick="{{value.isClick}}" data-preId="{{value.preId}}" data-executeDate="{{value.executeDate}}" data-diagnosisDate="{{value.diagnosisDate}}" data-recordTime="{{value.recordTime}}">'+
				'			<div class="paln-time">{{if value.diagnosisDate}}诊疗年龄{{else}}计划年龄{{/if}}：{{value.age}}</div>'+
				'			<div class="user-cp-info clearfix" style="background:{{value.color}}">'+
				//'				<span class="cp-seqNo">{{value.index+1}}</span>'+
				'				<span class="cp-name">{{value.nodeName}}</span>'+
				'				{{if value.nodeStatus == "1"}}'+
				'					<i class="fa fa-check-circle-o" aria-hidden="true" data-toggle="tooltip" data-placement="left" title="已完成"></i>'+
				//'				{{else if value.nodeStatus == "2"}}'+
				//'					<i class="fa fa-check-circle-o" aria-hidden="true" data-toggle="tooltip" data-placement="left" title="过期"></i>'+
				'				{{/if}}'+
				'			</div>'+
				'		</div>'+
				'		{{/each}}'+
				'	</div>'+
				'</script>';
	}

	var tasks = function(){
		return 	'<script id="tpl_user_tasks" type="text/html">'+
				'	<div class="user-node-tit" style="color:{{node.color}}">{{node.nodeName}}</div>'+
				'		<div class="user-tasks">'+
				'			{{each list as value i}}'+
				'			<div class="item clearfix" style="border-left-color:{{node.color}}">'+
				'				<div class="task-name">{{value.taskName}}</div>'+
				'				<div class="task-icons pull-left ml10">'+
				'					{{if value.vipcn}}<i class="fa fa-fa-weixin {{value.vipcnLight}}" aria-hidden="true" data-toggle="tooltip" data-placement="top" title="微信公众号渠道"></i>{{/if}}'+
				'					{{if value.ewm}}<i class="fa fa-qrcode {{value.ewmLight}}" aria-hidden="true" data-toggle="tooltip" data-placement="top" title="诊间扫码渠道"></i>{{/if}}'+
				'					{{if value.app}}<i class="fa fa-mobile {{value.appLight}}" aria-hidden="true" data-toggle="tooltip" data-placement="top" title="app渠道"></i>{{/if}}'+
				'					{{if value.clinic}}<i class="fa fa-refresh {{value.clinicLight}}" aria-hidden="true" data-toggle="tooltip" data-placement="top" title="其它医生登记记录同步"></i>{{/if}}'+
				'					{{if value.ehr}}<i class="fa fa-database {{value.ehrLight}}" aria-hidden="true" data-toggle="tooltip" data-placement="top" title="电子健康档案查询渠道"></i>{{/if}}'+
				'					{{if value.taskStatus=="1" || value.taskStatus=="2" }}'+
				'						<i class="fa fa-check-circle-o" aria-hidden="true" data-toggle="tooltip" data-placement="top" title="已完成"></i>'+
				'					{{/if}}'+
				'				</div>'+
				'				<div class="task-icons pull-right">'+
				'					<i class="fa fa-pencil-square-o icon-click" aria-hidden="true" data-toggle="tooltip" data-placement="top" title="编辑"></i>'+
				'				</div>'+
				'			</div>'+
				'			{{/each}}'+
				'		</div>'+
				/*'		<div class="add-task clearfix">'+
				'			<div class="task-name">添加任务</div>'+
				'			<div class="task-icons pull-right">'+
				'				<i class="fa fa-plus-circle" aria-hidden="true"></i>'+
				'			</div>'+
				'		</div>'+*/
				'</script>';
	}

	var dates = function(){
		return 	'<script id="tpl_user_dates" type="text/html">'+
				'	<div class="user-tips"><i class="fa fa-paperclip" aria-hidden="true"></i></div>'+
				'	<div class="item">'+
				'		<div class="tit clearfix">'+
				'			<span>计划日期</span>'+
				'			<i class="fa fa-clock-o" aria-hidden="true"></i>'+
				'		</div>'+
				'		<div class="item-content clearfix">'+
				'			<div><span class="item-content-date">{{executeDate}}</span>（±<span class="item-content-winDay">{{windowDay}}</span>日）</div>'+
				'			<i class="fa fa-pencil-square-o executeDate-edit" aria-hidden="true"></i>'+
				'		</div>'+
				'	</div>'+
				'	<div class="item">'+
				'		<div class="tit clearfix">'+
				'			<span>诊疗日期</span>'+
				'			<i class="fa fa-stethoscope" aria-hidden="true"></i>'+
				'		</div>'+
				'		<div class="item-content clearfix">'+
				'			<div>{{if diagnosisDate}}<span class="item-content-date">{{diagnosisDate}}</span>{{else}}---- 年 -- 月 -- 日{{/if}}</div>'+
				'			{{if diagnosisDate}}<i class="fa fa-pencil-square-o diagnosisDate-edit" aria-hidden="true"></i>{{/if}}'+
				'		</div>'+
				'	</div>'+
				'	<div class="item">'+
				'		<div class="tit clearfix">'+
				'			<span>登记日期</span>'+
				'			<i class="fa fa-check-circle-o {{if nodeStatus=="1"}}active{{/if}}" aria-hidden="true"></i>'+
				'		</div>'+
				'		<div>{{if recordTime}}{{recordTime}}{{else}} ---- 年 -- 月 -- 日{{/if}}</div>'+
				'	</div>'+
				'</script>';
	}

	var editDateWrap = function(){
		return  '<script id="tpl_user_editDateWrap" type="text/html">'+
				'	<div class="editDate-wrap">'+
				'		<div class="editDate-box" id="editDateBox"></div>'+
				'		<div class="btn-box">'+
				'			<div class="btn btn-default editDate-cancel">取消</div>'+
				'			<div class="btn btn-primary editDate-submit">保存</div>'+
				'		</div>'+
				'	</div>'+
				'</script>';
	}

	var editDate = function(){
		return  '<script id="tpl_user_editDate" type="text/html">'+
				'	<div class="form-horizontal clearfix">'+
				'		{{if flag == "1"}}'+
				'			<div class="qaCard form-group form-group-sm col-sm-11 col-md-11 grid-label-6">'+
				'				<label class="control-label">计划时间</label>'+
				'	 	  		<div class="control-input">'+
				'	 	  			<input type="date" class="form-control" name="executeDate" value="{{data.executeDate}}">'+
				'				</div>'+
				'			</div>'+
				'			<div class="qaCard form-group form-group-sm col-sm-11 col-md-11 grid-label-6">'+
				'				<label class="control-label">窗口期天数</label>'+
				'	 	  		<div class="control-input">'+
				'	 	  			<input type="number" class="form-control" min="0" name="winDay" value="{{data.windowDay}}">'+
				'				</div>'+
				'			</div>'+
				'			<div class="qaCard form-group form-group-sm col-sm-11 col-md-11 grid-label-6">'+
				'				<label class="control-label">应用范围</label>'+
				'	 	  		<div class="control-input">'+
				'					<select class="form-control" name="flag">'+
				'	   				<option value="0">当前节点生效</option>'+
				'	   				<option value="1">区分业务类型 同一种业务类型的当前及后续节点都生效</option>'+
				'	   				<option value="2">不区分业务类型 当前及所有后续节点都生效</option>'+
				'					</select>'+
				'				</div>'+
				'			</div>'+
				'		{{else if flag == "2"}}'+
				'			<div class="qaCard form-group form-group-sm col-sm-11 col-md-11 grid-label-6">'+
				'				<label class="control-label">诊疗日期</label>'+
				'	 	  		<div class="control-input">'+
				'	 	  			<input type="date" class="form-control" name="diagnosisDate" value="{{data.diagnosisDate}}">'+
				'				</div>'+
				'			</div>'+
				'		{{/if}}'+
				'	</div>'+
				'</script>';
	}

	var editWrap = function(){
		return  '<script id="tpl_user_editWrap" type="text/html">'+
				'	<div class="editModal-wrap">'+
				'		<div class="edit-wrap" id="editBox"></div>'+
				'		{{if preTaskBtnShow}}<div class="user-arrow user-arrow-left"><i class="fa fa-chevron-circle-left" aria-hidden="true"></i></div>{{/if}}'+
				'		{{if nextTaskBtnShow}}<div class="user-arrow user-arrow-right"><i class="fa fa-chevron-circle-right" aria-hidden="true"></i></div>{{/if}}'+
				'	</div>'+
				'</script>';
	}

	var questWrap = function(){
		return  '<script id="tpl_user_questWrap" type="text/html">'+
				'	<div class="quest-wrap">'+
				'		<div class="quest-box" id="questBox"></div>'+
				'		<div class="btn-box">'+
				'			{{if curTask.subBusiType=="B0110" && (curTask.taskStatus=="1" || curTask.taskStatus=="2")}}'+ // 体格评估
				'				<div id="gotoReport" class="btn btn-success">查看报告</div>'+
				'			{{/if}}'+
				'			{{if synchFlag && synchFlag == "Y"}}'+
				'				<div id="questSave" class="btn btn-default">保存</div>'+
				'				<div id="questSaveAndSend" class="btn btn-primary">保存并发送</div>'+
				'			{{else}}'+
				'				<div id="questSave" class="btn btn-primary">保存</div>'+
				'			{{/if}}'+
				'		</div>'+
				'	</div>'+
				'</script>';
	}

	var baseInfo = function(){
		return  '<script id="tpl_user_baseInfo" type="text/html">'+
				'	<div class="clearfix">'+
				'		<div class="pull-left babycardCheck-hisno ellipsis-1">{{if hisNo}}{{hisNo}}{{else}}{{phoneNo}}{{/if}}</div>'+
				'		<div class="pull-right babycardCheck-ischeck ellipsis-1">'+
				'			{{if taskAuditFlag=="Y"}}<i class="fa fa-question-circle" aria-hidden="true" data-toggle="tooltip" data-placement="left" title="内容待审核"></i>{{/if}}'+
				'		</div>'+
				'	</div>'+
				'	<div class="babycardCheck-row02 clearfix">'+
				'		<div class="pull-left babycardCheck-avatar clickbabycard-icon"><img src="page/res/imgs/{{if gender == "F" && queueUserType == "0"}}icon_girl{{else if gender == "M" && queueUserType == "0"}}icon_boy{{else}}icon_mother{{/if}}.png"></div>'+
				'		<div class="pull-left babycardCheck-con">'+
				'			<div class="clearfix">'+
				'				<span class="babycardCheck-name clickbabycard-name ellipsis-1">{{if isPremature}}<i class="babycardCheck-premature">早</i>{{/if}}{{userName}}</span>'+
				'				<span class="babycardCheck-age ellipsis-1">{{age}}</span>'+
				'			</div>'+
				'			<div class="babycardCheck-queuename clickbabycard-queuename ellipsis-1">{{queueName}}</div>'+
				'		</div>'+
				'	</div>'+
				'	<div class="progress-wrap">'+
				'		{{each nodeStatusArr as item i}}'+
				'			<div style="width:{{width}}"><i class="{{item.className}}" data-toggle="tooltip" data-placement="top" title="{{item.title}}"></i></div>'+
				'		{{/each}}'+
				'	</div>'+
				'</script>';
	}

	return tpl;
});